package edu.sctu.practice.class01.zhoudie.assgin03;

/**
 * Created by Administrator on 2015-10-22.
 */

public class Rectangle extends GeometricObject {
    protected double width;
    protected double height;

    public Rectangle() {

    }
    public Rectangle(double width, double height, String color) {
        super(color);
        this.width = width;
        this.height = height;
    }
    public double findArea() {
        return width*height;
    }
    public double findPerimeter() {
        return 2*(width + height);
    }
    public String toString() {
        return "矩形的宽为： " + width + "  高为： " + height+"  颜色为："+color;
    }
}
